﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using SinsenMVC.Helpers;
using SinsenWeb.Helpers;
using SinsenWeb.Models;


namespace SinsenWeb.Views.Members
{
    public partial class Show : ViewPageBase<Member>
    {
        public Member Member
        {
            get
            {
                return ViewData.Model;
            }
        }

        protected string GetEditMemberLink()
        {
            if (Helper.CanEditMember(Member))
            {
                return Html.ActionLink("(rediger opplysninger)", "Edit", new { Member.Id });
            }
            return "";

        }

        protected string GetSetMemberPauseStatusLink()
        {
            if(SecurityHelper.HasRights(SecurityRole.AttendanceNazi))
            {
                return Html.ActionLink("(Sett permisjonsstatus)", "EditPause", new {Member.Id});
            }
            return "";
        }
    }
}
